//
//  Information.m
//  Pocket Doctor alpha version
//
//  Created by Sherif, Yin, Taylor, Jacob, Anna, Mike on 11-10-25.
//  Copyright (c) 2011 __Sytjam__. All rights reserved.
//
//Class Description: Credits - website - description - facebook - google+ - twitter.
//
//Known Bugs: none.
//

#import "Information.h"
#import "MainMenu.h"

@implementation Information

@synthesize info, credits, back, website, facebook, googleplus, twitter, scrollview;
@synthesize mm;

//Going back to main menu (dismissing current view)
- (IBAction)Back:(id)sender{
    /*MainMenu *mmObject = [[MainMenu alloc]initWithNibName:@"MainMenu" bundle:nil];
    self.mm = mmObject;
    [mmObject release];*/
    
    [self dismissModalViewControllerAnimated:YES];
}

//goes to safari and loads our website
- (IBAction)WebsiteSafari:(id)sender{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://code.google.com/p/cmpt275-fall11-12/"]];
}

//goes to safari to facebook page
- (IBAction)FindUsOnFacebook:(id)sender{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.facebook.com/sytjam"]];
}

//goes to safari to google+ page
- (IBAction)CircleUsOnGooglePlus:(id)sender{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://plus.google.com/sytjam"]];
}

//goes to safari to twitter page
- (IBAction)FollowUsOnTwitter:(id)sender{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://twitter.com/sytjam"]];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}


#pragma mark - View lifecycle

- (void)viewDidLoad
{
    //preparing text and puting it onto the display
    
    self.info.text = @"Pocket Doctor\n“The Pharmacy at your Fingertips!”\n\nThis project is for CMPT 275; Introduction to Software Engineering I.  Professor, Dr. Herbert Tsang at Simon Fraser University.";
    
    self.credits.text = @"\n\nMike Lim\n\n\n\nSherif Nosseir\nMike Lim\nJacob Cheng\n\n\n\nSherif Nosseir\n\n\n\nYiting \"Anna\" Zhi\nYin Yuan\nTaylor Guo\nSherif Nosseir\n\n\n\nYin Yuan\n\n\n\nHaatem Belgasem\nArabi Elhouderi\nKuuku Nana Affainyi\nSherif Nosseir\nMike Lim\nTaylor Guo\nYin Yuan\nYiting \"Anna\" Zhi\n Jacob Cheng\n\nPocket Doctor\nAll rights reserved Sytjam.\n\n";
    
    scrollview.contentSize = CGSizeMake(320, 1150);
    
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)dealloc{
    
    [mm release];
    
    
    [scrollview release];
    [info release];
    [website release];
    [facebook release];
    [googleplus release];
    [twitter release];
    [credits release];
    [back release];
    
    [super dealloc];
}

@end
